/// @tags:
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <numeric>

using std::cin, std::cout, std::endl;

namespace BlueQuantum {

typedef long long ll;

constexpr int maxn = 100;

int main() {
  ll x;
  int k;
  cin >> x >> k;
  ll exp = 1;
  for (int i = 1; i <= k; ++i) {
    exp *= 10;
    if (x % exp == 0) continue;
    double tmp = (double)x / exp;
    if ((ceil(tmp) - tmp) <= (tmp - floor(tmp))) {
      x = (x / exp + 1) * exp;
    } else
      x = x / exp * exp;
  }
  cout << x;
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("B - Broken Rounding.in", "r", stdin);
  freopen("B - Broken Rounding.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
